﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="Devices_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Stylesheet" Runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="SubNavigation" Runat="Server">
    <ul>
        <li class="first">
            <a href="default.aspx">Overview</a>
        </li>
        <li  class="last">
            <a href="adddevice.aspx">Add Cloud Server</a>
        </li>
    </ul>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="PageHeader" Runat="Server">
    Devices
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="MainContent" Runat="Server">
    <div style="width: 70%; float:left; padding-right: 20px;padding-top:10px; border-right:1px solid #C0C0C0;">       
        <asp:DataList ID="dlUsers" runat="server" Width="100%"
            BorderWidth="0px"  CellPadding="0" onitemdatabound="dlUsers_ItemDataBound">
                <ItemTemplate>
                    <div style="width:100%;border-bottom:1px solid #C0C0C0"><b><%# Eval("Name")%> <%#(Convert.ToString( Eval("FriendlyName") )!= "")?"(" + Eval("FriendlyName") +")":"" %></b></div>
                    <div style="width:100%;padding-top: 10px">
                        <div style="width:20%; list-style-type:none;float:left;padding-left:5%">                         
                            <asp:HyperLink ID="HyperLink2" NavigateUrl='<%# Convert.ToString(Eval("DeviceType"))=="D"?"devicesdetails.aspx?Deviceid="+Eval("Id"):"~/Server/Firewall/default.aspx?FirewallId="+Eval("Id") %>' runat="server">
                                <asp:Image ID="imgDevice" runat="server" BorderWidth="0" ImageUrl='<%# Convert.ToString(Eval("DeviceType"))=="D"?"~/Resources/Images/Device.jpg":"~/Resources/Images/firewall.gif" %>' />
                            </asp:HyperLink>
                        </div>
                        <div style="width:70%;float:left;text-align:left;list-style-type:none">
                             <ul>
                                    <li>
                                        <%# Eval("OS.Name")%>
                                    </li>
                                    <li>
                                        <%# (Convert.ToString(Eval("Plan.CPUs"))!="")?"CPU: "+Eval("Plan.CPUs"):""%>
                                    </li>
                                    <li>                                    
                                        <%# (Convert.ToString(Eval("Plan.Ram")) != "") ? "Memory: "+Eval("Plan.Ram"): ""%>
                                    </li>
                                    <li>
                                        <asp:HyperLink ID="HyperLink1" NavigateUrl='<%# Convert.ToString(Eval("DeviceType"))=="D"?"devicesdetails.aspx?Deviceid="+Eval("Id"):"~/Server/Firewall/default.aspx?FirewallId="+Eval("Id") %>' runat="server">Details</asp:HyperLink>
                                    </li>
                                </ul>
                        </div>
                    </div>
                </ItemTemplate>
            </asp:DataList>     
    </div>
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="SideBar" Runat="Server">
    <div align="left" style="width:25%; float:left;padding-left:20px">
        <div>Options</div>
        <hr />
        <asp:HyperLink ID="hplAddCloud" runat="server" 
            NavigateUrl="~/Server/Device/adddevice.aspx">Add Cloud Server</asp:HyperLink>
    </div>
</asp:Content>